﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" xmlns:local="clr-namespace:Faust.Andrew.MTG"
	x:Class="Faust.Andrew.MTG.ImportWindow"
	x:Name="Window"
	Title="Import Cards"
	Width="897" Height="699" Background="{DynamicResource DefaultWindowBackground}" Icon="/MTGManager;component/MTGManagerIcon.ico">

	<Grid x:Name="LayoutRoot" Margin="5">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
		<Grid x:Name="GridControl" Margin="0" Background="{DynamicResource ControlBoxBrush}">
			<Grid.RowDefinitions>
				<RowDefinition Height="0.472*"/>
				<RowDefinition Height="0.528*"/>
			</Grid.RowDefinitions>
			<Grid x:Name="GridMainControl" Margin="5,0">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Label HorizontalAlignment="Left" Margin="0" Content="File" VerticalAlignment="Center"/>
				<TextBox x:Name="FileTextBox" Margin="0" Grid.Column="1" TextWrapping="Wrap" VerticalAlignment="Center"/>
				<CheckBox x:Name="SkipFirstCheckBox" HorizontalAlignment="Left" Margin="0,9,0,0" Content="Skip First Line" Grid.Row="1" VerticalAlignment="Center" IsChecked="True"/>
				<Button x:Name="ButtonPreview" Content="Preview" Grid.Row="2" Padding="5,1" d:LayoutOverrides="GridBox" HorizontalAlignment="Right" Grid.ColumnSpan="3" Click="ButtonPreview_Click"/>
				<Button x:Name="ButtonBrowse" HorizontalAlignment="Right" Margin="5,0,0,0" Content="..." Grid.Column="2" VerticalAlignment="Center" Padding="5,1" Click="ButtonBrowse_Click"/>
			</Grid>
			<Expander x:Name="ExpanderDeck" Margin="0,5,0,0" Grid.Row="1" Header="Import Deck" Padding="0,0,0,5" BorderBrush="{x:Null}" Background="{DynamicResource ControlBoxBrush}">
				<Grid x:Name="GridDeck" Margin="5,0" Background="{DynamicResource ControlBoxBrush}">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition/>
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto"/>
						<RowDefinition Height="Auto"/>
						<RowDefinition Height="Auto"/>
						<RowDefinition Height="Auto"/>
					</Grid.RowDefinitions>
					<CheckBox x:Name="chkCreateDeck" HorizontalAlignment="Left" Margin="0,0,10,0" Content="Create Deck" VerticalAlignment="Center"/>
					<CheckBox x:Name="chkUpdateOwned" HorizontalAlignment="Left" Margin="0" Content="Update Owned Quantity" Grid.Column="1" IsChecked="True" VerticalAlignment="Center"/>
					<Label HorizontalAlignment="Left" Margin="0" VerticalAlignment="Center" Content="Name:" Grid.Row="1"/>
					<Label HorizontalAlignment="Left" Margin="0" VerticalAlignment="Center" Content="Description:" Grid.Row="2"/>
					<TextBox x:Name="txtDeckName" Margin="0" VerticalAlignment="Bottom" TextWrapping="Wrap" Grid.Row="1" Grid.Column="1"/>
					<TextBox x:Name="txtDeckDescription" Margin="0" Grid.Row="3" TextWrapping="Wrap" Grid.ColumnSpan="2" Background="White" AcceptsReturn="True" AcceptsTab="True" MaxHeight="200" MinHeight="50" BorderBrush="{x:Null}"/>
				</Grid>
			</Expander>
		</Grid>
		<Grid x:Name="GridContent" Margin="0,5" Grid.Row="1">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<TreeView x:Name="TreeCards" Margin="0,0,5,0" Background="{DynamicResource ControlBoxBrush}" Padding="1,1,5,1" Grid.RowSpan="2" ScrollViewer.HorizontalScrollBarVisibility="Auto" MinWidth="150" SelectedItemChanged="TreeCards_SelectedItemChanged" ScrollViewer.VerticalScrollBarVisibility="Visible">
				<TreeView.ContextMenu>
					<ContextMenu>
						<MenuItem x:Name="ClearMatchMenu" Header="Clear Match" Click="ClearMatchMenu_Click"/>
					</ContextMenu>
				</TreeView.ContextMenu>
			</TreeView>
			<ListBox x:Name="CardsListBox" Margin="0" Grid.Column="1" Background="{x:Null}" Grid.Row="1" ItemTemplate="{DynamicResource CardItemTemplate}" ItemContainerStyle="{DynamicResource CardItemContainerTemplate}" ItemsPanel="{DynamicResource CardLayoutTemplate}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
				<ListBox.ContextMenu>
					<ContextMenu>
						<MenuItem x:Name="MenuSetCard" Header="_Set Card" Click="MenuSetCard_Click"/>
					</ContextMenu>
				</ListBox.ContextMenu>
			</ListBox>
			<Grid x:Name="SearchPanel" Margin="0,0,0,3" Grid.Column="1">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<TextBox x:Name="SearchTextBox" HorizontalAlignment="Right" TextWrapping="Wrap" VerticalAlignment="Center" Margin="0,0,3,0" MinWidth="100" KeyDown="SearchTextBox_KeyDown"/>
				<Button x:Name="SearchButton" HorizontalAlignment="Left" Margin="3,0,0,0" Content="Search" Grid.Column="1" VerticalAlignment="Center" Padding="3,1" Click="SearchButton_Click"/>
				<local:PagingControl x:Name="pageControl" Margin="0" d:LayoutOverrides="Width, Height" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Center" PageChangedEvent="pageControl_PageChangedEvent"/>
			</Grid>
		</Grid>
		<Grid x:Name="GridFooter" Margin="0" Grid.Row="2">
			<Grid.ColumnDefinitions>
				<ColumnDefinition/>
			</Grid.ColumnDefinitions>
			<Button x:Name="ButtonSave" Margin="0" Content="Save" Grid.Column="2" Width="60" HorizontalAlignment="Right" VerticalAlignment="Center" Click="ButtonSave_Click"/>
			<Button x:Name="ButtonCancel" Margin="0,0,70,0" Content="Cancel" Grid.Column="1" Width="60" HorizontalAlignment="Right" VerticalAlignment="Center" Click="ButtonCancel_Click"/>
		</Grid>
		<StatusBar x:Name="ProcessingStatusBar" Margin="0,5,0,0" Grid.Row="3" Visibility="Collapsed">
			<ProgressBar x:Name="ImportProgress" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" Maximum="0" Width="200" Height="15" IsIndeterminate="True"/>
			<Label x:Name="ProgressLabel" Content="Card: "/>
		</StatusBar>
	</Grid>
</Window>